﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace LynxBlogAPI.Models.Mapping
{
    public class PageDataMap : EntityTypeConfiguration<PageData>
    {
        public PageDataMap()
        {
            this.HasKey(t => t.pageid);

            this.Property(t => t.pageid).HasColumnName("PageId").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(t => t.blogid).HasColumnName("BlogId").HasMaxLength(50).IsRequired();
            this.Property(t => t.title).HasColumnName("Title").HasMaxLength(150).IsRequired();
            this.Property(t => t.description).HasColumnName("Description").IsRequired();
            this.Property(t => t.wp_page_parent_id).HasColumnName("WP_Page_Parent_Id").HasMaxLength(50);
            this.Property(t => t.wp_page_order).HasColumnName("WP_Page_Order").HasMaxLength(50).IsRequired();
            this.Property(t => t.IsPublished).HasColumnName("IsPublished").IsRequired();
            this.Property(t => t.DateCreated).HasColumnName("DateCreated").IsRequired();
            this.Property(t => t.license).HasColumnName("License").HasMaxLength(20);
            this.Property(t => t.commentsclosed).HasColumnName("CommentsClosed").IsRequired();
            this.ToTable("tblPageData");
        }
    }
}